package com.codeforces.contest.c318;

import java.util.Scanner;

public class _318A {

	static Scanner scanner = new Scanner(System.in);
	static long n, k;

	public static void main(String[] args) {
		n = scanner.nextLong();
		k = scanner.nextLong();
		if (n % 2 == 0) {
			if (k <= n / 2) {
				System.out.println(2*k-1);
			}
			else {
				k -= (n / 2);
				System.out.println(2*k);
			}
		}
		else {
			if (k <= (n+1) / 2) {
				System.out.println(2*k-1);
			}
			else {
				k -= (n+1) / 2;
				System.out.println(2*k);
			}
		}
	}

}
